home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / ezwindo1.zip / EZWINDO.DOC < prev    next >
Text File  |  1991-01-19  |  13KB  |  288 lines

  1.                   The EZ-WINDOWS PullDown Menu System
  2.  
  3.       "Terrific, a beautiful piece of programming!" - Duiven, Holland
  4.  
  5.  
  6.            A Complete Menu System for the QuickBasic 4.x Compiler
  7.             and MS Professional Development System 7.0 and up.
  8.  
  9.                                   by
  10.  
  11.             StrongSoft Engineering
  12.                           3155 S.W. 178th Ave
  13.                             Aloha, OR 97006
  14.  
  15.        Documentation written & prepared by John C. Strong
  16.  
  17.  
  18. OVERVIEW
  19.  
  20.      This routine is intended to allow a programmer to present the user
  21. with options in an organized and aesthetic way.  The PullDown Menu System was
  22. indeed modeled after the very pulldown menu used in the QuickBASIC 4.x
  23. environment.  
  24.  
  25.      I wrote this routine out of frustration, actually.  I didn't want to
  26. take the time to write a pulldown menu routine, yet none of the commercially
  27. available libraries offered the options that I needed.  So I just sat down
  28. one day and wrote it, and here it is.
  29.  
  30.      The PullDown Menu System is very easy to integrate in a QB program,
  31. yet offers all the options someone might expect in a commercial software
  32. package.  To use this routine in a program, all that is required is a few
  33. arrays containing formatting information for the pulldown menu and an array
  34. containing the actual text used.  Then a simple CALL statement will take care
  35. of the rest!  Don't worry -- loading the arrays required for the routine is
  36. very straightforward and uncomplicated, and the results are definitely worth
  37. it!
  38.  
  39.      The advantages of using this routine are both numerous and obvious, but
  40. there is one disadvantage:  the code size is rather large.  But the programs
  41. that need such a pulldown menu routine are the ones that need to present a
  42. multitude of options to the user -- such a program will naturally be large
  43. anyway, so the relative code size of the PullDown Menu System shouldn't make
  44. a big difference.
  45.  
  46.  
  47. REQUIREMENTS
  48.  
  49.      The PullDown Menu System requires QuickBASIC 4.0 Compiler or above.  I
  50. don't know if it will work with earlier versions.  I believe earlier versions
  51. of QuickBASIC modify the stack a bit differently when passing parameters to
  52. assembler routines, which would definitely cause problems.  So if you don't
  53. have version 4.0 or later, you would be doing yourself a great favor by
  54. upgrading if for no other reason than to enjoy the benefits of a superior
  55. programming environment provided by QB45 or PDS 7.0.
  56.  
  57.      You can use this routine inside the QB environment or in a compiled
  58. .EXE file.  Two Quick Libraries are provided for program development inside
  59. QB and two libraries are provided for compiled programs.    
  60.  
  61.  
  62. USING THE PULLDOWN MENU SYSTEM
  63.  
  64.     Using this routine requires the dimensioning and loading of several
  65. arrays and the actual call to the routine.  When calling the routine, several
  66. conventions must be observed:
  67.  
  68.      1)    All non-string variable arguments must be the integer type,
  69.            denoted by the percent sign %, i.e., ITEMSLCT%.  Alternativ-
  70.            ely, the DEFINT statement can be used at the beginning of
  71.            your program which will take care of this automatically.  You
  72.            can also pass literals instead of integer variables, but only
  73.            for arguments that are not modified by the routine.  The best
  74.            thing to do is just pass variables, which requires less stack
  75.            space than literals.
  76.  
  77.      2)    The arguments passed must be in proper order or the routine
  78.            will not work, possibly locking up your system.
  79.  
  80.      3)    All arguments must be present or the routine will not work,
  81.            possibly locking up your system.
  82.  
  83.  
  84.  
  85. CALLING THE ROUTINE
  86.  
  87.      This is the required format for calling this routine:
  88.  
  89.  
  90.      CALL PULLDOWN(MENUBAR$,MenuRow%,MenuCol%,MenuFG%, MenuBG%,HiliteFG%,
  91.                    HiBarFG%,HiBarBG%,NonValidFG%,HiPos1%(),HiPos2%(),
  92.                    MaxSize%(),MaxItems%(),item$(),valid%(),toggle%(),ms%,
  93.                    ClearAfter%,Seed%,SoundOn%,Blink%,MenuSlct%,ItemSlct%)
  94.  
  95.  
  96.      Arguments:     MENUBAR$ - A string variable holding each pulldown menu
  97.                                name.  The number of menus is determined by
  98.                                the number of names is this string, which
  99.                                must be separated by at least one space on
  100.                                each side.  A space character must be the last
  101.                                character in the string.
  102.  
  103.                     MenuRow% - The row on which the menu bar will be 
  104.                                displayed.
  105.  
  106.                     MenuCol% - The column of the leftmost character in the
  107.                                menu bar.  For a full length menu bar, this
  108.                                would be set to one (1).
  109.  
  110.                      MenuFG% - The foreground color of the menubar and menus.
  111.  
  112.                      MenuBG% - The background color of the menubar and menus.
  113.  
  114.                    HiLiteFG% - The foreground color of the 'hot' letter in
  115.                                each selection.  Bright white (15) or yellow
  116.                                (14) work the best.
  117.  
  118.                     HiBarFG% - The foreground color of the text selected by
  119.                                the hilite bar.
  120.  
  121.                     HiBarBG% - The background color of the hilite bar.
  122.  
  123.                  NonValidFG% - The foreground color of the selections not 
  124.                                currently valid.  Gray (8) works the best here.
  125.  
  126.                    HiPos1%() - The integer array, dimensioned to the number of
  127.                                menus, holding the position of the 'hot'
  128.                                letter in each menu name in the MENUBAR$
  129.                                variable.  These letters will be hilited with
  130.                                the color specified in the HiliteFG% variable.
  131.  
  132.                    HiPos2%() - A 2-dimensional integer array holding the 
  133.                                position of the 'hot' letter in each menu item
  134.                                for each menu. It's first dimension is the
  135.                                number of the menu, the second is the 
  136.                                number of the selection in the menu.  
  137.                                Dimension it for the number of menus and the 
  138.                                number of items in the largest menu.  For
  139.                                example,
  140.                                     DIM HiPos2%(menu%,slct%)
  141.  
  142.                   MaxSize%() - An integer array holding the length of the
  143.                                longest item in each menu.
  144.  
  145.                  MaxItems%() - An integer array holding the number of items in
  146.                                each menu.
  147.  
  148.                      Item$() - A 2-dimensional array holding the items for
  149.                                selection for each menu.  It is dimensioned
  150.                                like HiPos2%(),
  151.                                     DIM Item$(menu%,slct%)
  152.  
  153.                     Valid%() - A 2-dimensional flag array that determines if
  154.                                an item is valid for selection or not.  A value
  155.                                of 1 is valid; 0 means not valid, and the item
  156.                                is grayed-out.  It is dimensioned like
  157.                                HiPos2%().
  158.  
  159.                    Toggle%() - A 2-dimension flag array that determines the 
  160.                                toggling status of each item in each menu.  
  161.                                
  162.                                    2   -   exclusive toggle, on
  163.                                    1   -   inclusive toggle, on
  164.                                    0   -   no toggling
  165.                                   -1   -   inclusive toggle, off
  166.                                   -2   -   exclusive toggle, off
  167.  
  168.                                If toggling is used in a menu, it must all be
  169.                                of one type, either all exclusive or all
  170.                                inclu